<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>小米商城-个人中心</title>
		<link rel="icon" href="//s01.mifile.cn/favicon.ico"/>
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<script type="text/javascript" src="js/jquery-3.3.1.min.js" ></script>
		<script type="text/javascript" src="js/bootstrap.min.js" ></script>
		<script type="text/javascript" src="js/OrderInfo.js" ></script>
		<script src="js/axios.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/web.js" ></script>
		
	</head>
	<body style="min-height: 800px;">
		<div id="ddd" style="position: relative;">
	<!-- start header -->
		<header>
			<div class="top center">
				<div class="left fl">
					<ul>
						<li><a href="index.html" target="_blank">小米商城</a></li>
						<li>|</li>
						<li><a href="">MIUI</a></li>
						<li>|</li>
						<li><a href="">米聊</a></li>
						<li>|</li>
						<li><a href="">游戏</a></li>
						<li>|</li>
						<li><a href="">多看阅读</a></li>
						<li>|</li>
						<li><a href="">云服务</a></li>
						<li>|</li>
						<li><a href="">金融</a></li>
						<li>|</li>
						<li><a href="">小米商城移动版</a></li>
						<li>|</li>
						<li><a href="">问题反馈</a></li>
						<li>|</li>
						<li><a href="">Select Region</a></li>
						<div class="clear"></div>
					</ul>
				</div>
				<div class="right fr">
					<div class="gouwuche fr"><a href="gouwuche.html">购物车</a></div>
					<div class="fr">
						<ul>
							<li><a style="cursor:pointer" v-on:click="jump()" target="_blank">{{omg}}</a></li>
							<li>|</li>
							<li><a href="./register.html" target="_blank" >注册</a></li>
							<li>|</li>
							<li><a href="#top">个人中心</a></li>
						</ul>
					</div>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
		</header>
	<!--end header -->
	<!-- start banner_x -->
		<div class="banner_x center">
			<a href="./index.html" target="_blank"><div class="logo fl"></div></a>
			<a href=""><div class="ad_top fl"></div></a>
			<div class="nav fl">
				<ul>
					<!--模糊搜索全部商品-->
					<li v-on:click="search()"><a href="#">全部商品</a></li>
					<!--点击时传入类名（如小米手机），存下来跳到下一页时取出-->
					<li v-on:click="go('小米手机')"><a href="liebiao.html" >小米手机</a></li>
					<li v-on:click="go('红米手机')"><a href="liebiao.html" >红米手机</a></li>
					<li v-on:click="go('笔记本电脑')"><a href="liebiao.html" >笔记本电脑</a></li>
					<li v-on:click="go('电视')"><a href="liebiao.html" >电视</a></li>
					<li v-on:click="go('路由器')"><a href="liebiao.html" >路由器</a></li>
					<li v-on:click="go('智能硬件')"><a href="liebiao.html" >智能硬件</a></li>
				</ul>
			</div>
			<div class="search fr">
				<form action="search.html" >
					<div class="text fl">
						<input id="inp" type="text" class="shuru"  >
					</div>
					<div class="submit fl">
						<!--模糊搜索商品-->
						<input type="submit" class="sousuo" value="搜索" v-on:click="search()"/>
					</div>
					<div class="clear"></div>
				</form>
				<div class="clear"></div>
			</div>
		</div>
<!-- end banner_x -->
<!-- self_info -->
	<div class="grzxbj">
		<div class="selfinfo center">
		<div class="lfnav fl">
			<div class="ddzx">订单中心</div>
			<div class="subddzx">
				<ul>
					<li>
						<div class="dropdown" style="margin-left: -12px;">
						  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
						    我的订单
						    <span class="caret"></span>
						  </button>
						  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
						    <li><a id="c" v-on:click="vary($event);dian1()">待支付订单</a></li>
						    <li><a id="d" v-on:click="vary($event);dian2()">待发货订单</a></li>
						    <li><a id="e" v-on:click="vary($event);dian3()">待收货订单</a></li>
						    <li><a id="f" v-on:click="vary($event);dian4()">已收货订单</a></li>
						    <li><a id="g" v-on:click="vary($event);dian5('1')">全部订单</a></li>
						  </ul>				
						</div>
					</li>
					<li><a href="">意外保</a></li>
					<li><a href="">团购订单</a></li>
					<li><a href="">评价晒单</a></li>
				</ul>
			</div>
			<div class="ddzx">个人中心</div>
			<div class="subddzx">
				<ul>
					<li><a id="a" v-on:click="xinxi()">我的个人中心</a></li>
					<li><a id="h" v-on:click="cx()">我的收藏</a></li>
					<li><a>优惠券</a></li>
					<li><a>收货地址</a></li>
				</ul>
			</div>
		</div>
		<div id="motai6" class="rtcont1 fr" ><img style="width: 980px;height: 500px;" src="image/ddxqbgtc.jpg"/></div>
		<div id="motai" class="rtcont fr">
			<div style="margin: 30px 100px 50px 100px;" class="grzlbt ml40"><span style="font-size: 22px;">我的资料</span></div>
			<table id="tatatat" class="container table table-hover" style=" width: 80%; padding: 20px 20px 20px 20px;">
					<tr>
						<th style="margin-right: 50px;">昵称:</th>
						<td>{{name11}}</td>
						<td><a id="b">修改</a></td>
					</tr>
					<tr>
						<th style="margin-right: 50px;">手机号:</th>
						<td>{{phone11}}</td>
						
					</tr>
					<tr>
						<th style="margin-right: 50px;">密码:</th>
						<td>{{password11}}</td>
						
					</tr>
					<tr>
						<th style="margin-right: 50px;">个性签名:</th>
						<td>{{qming11}}</td>
						
					</tr>
					<tr>
						<th style="margin-right: 50px;">年龄:</th>
						<td>{{age11}}</td>
						
					</tr>
					<tr>
						<th style="margin-right: 50px;">收货地址:</th>
						<td>{{address11}}</td>
						
					</tr>
			</table>
		</div>
		<div id="motai1" class="rtcont fr">
			<div class="grzlbt ml40">资料修改</div><div style="width: 100%;"><span style="font-size: larger; text-align: center; display: block; color: red;">{{information}}</span></div>
			<table id="tatatat" class="container table table-hover" style=" width: 80%; padding: 20px 20px 20px 20px;">
					<tr>
						<th style="margin-right: 50px;">昵称:</th>
						<td><input class="form-control" style="font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="name11" type="text"  /></td>		
					</tr>
					<tr>
						<th style="margin-right: 50px;">手机号:</th>
						<td><input class="form-control" style="font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="phone11" type="text" name="tel" /></td>
					</tr>
					<tr>
						<th style="margin-right: 50px;">密码:</th>
						<td><input class="form-control" style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="password11" type="password" name="password" /></td>
					</tr>
					<tr>
						<th style="margin-right: 50px;">个性签名:</th>
						<td><input class="form-control" style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="qming11" type="text" name="conent" /></td>
					</tr>
					<tr>
						<th style="margin-right: 50px;">年龄:</th>
						<td><input class="form-control" style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="age11" type="text" name="age" /></td>
					</tr>
					<tr>
						<th style="margin-right: 50px;">收货地址:</th>
						<td><input class="form-control" style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="address11" type="text" name="address" /></td>
					</tr>				
			</table>
			<div><button class="btn btn-info" @click="altermessage" v-on:click="setTimer" style="float: right; width: 150px;">确认修改</button></div>
			
			
			<!--<div class="grzlbt ml40">资料修改</div>  <div style="width: 100%;"><span style="font-size: larger; text-align: center; display: block; color: red;">{{information}}</span></div>      
			<div class="subgrzl ml40"><span>昵称</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="name11" type="text"  /></span></div>
			<div class="subgrzl ml40"><span>手机号</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="phone11" type="text" name="password" /></span></div>
			<div class="subgrzl ml40"><span>密码</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="password11" type="password" name="password" /></span></div>
			<div class="subgrzl ml40"><span>个性签名</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="qming11" type="text" name="password" /></span></div>
			<div class="subgrzl ml40"><span>年龄</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="age11" type="text" name="password" /></span></div>
			<div class="subgrzl ml40"><span>收货地址</span><span><input style="width: 100%; height: 100%; font-size: larger; border-top: none; border-bottom: none; border-right: none;" class="shurukuang" v-model="address11" type="text" name="password" /></span></div>
			<div><div><a href="self_info.html"><button style="float: left; width: 150px;">返回上一页</button></a></div><div><button @click="altermessage" v-on:click="setTimer" style="float: right; width: 150px;">确认修改</button></div></div>
		</div>-->				
				<div class="clear"></div>
			</div>
			<!---->
			
			<!--查询未付款订单-->
		<div id="motai2" class="rtcont fr" id="d1" style=" overflow-x: hidden; overflow-y: auto; overflow: scroll; background-color:white;position: absolute;margin-left: 250px;display: none;">
			<div class="ddzxbt"style="border: none;">{{check}}</div>
			<div class="table-responsive">
			<table id="downdowntable" class="table table-bordered">
					<tr>
						<th>订单编号</th>
						<th>订单价格</th>
						<th>订单备注</th>
						<th>订单状态</th>
						<th>订单时间</th>
						<th>操作</th>
						<th>选择</th>
					</tr>
					<tr v-for="pro in list1">
						<td>{{pro.id}}</td>
						<td>{{pro.totalPrice}}</td>
				      	<td>{{pro.comment}}</td>
				      	<td>未付款</td>
						<td>{{pro.datetime}}</td>
						<td><a v-on:click="detail(pro.id)">取消</a></td>
						<td><a v-on:click="price(pro.id)">去付款</a></td>
					</tr>
				</table>
			</div>
		</div>
		<!--查询待发货订单-->
		<div id="motai3" class="rtcont fr" id="d2" style=" overflow: scroll;background-color:white;">
			<div class="ddzxbt" style="border: none;">{{check}}</div>
			<div class="table-responsive">
			<table id="downdowntable" class="table table-bordered">
					<tr>
						<th>订单编号</th>
						<th>订单价格</th>
						<th>订单备注</th>
						<th>订单状态</th>
						<th>订单时间</th>
						<th>操作</th>
						
					</tr>
					<tr v-for="pro in list2">
						<td>{{pro.id}}</td>
						<td>{{pro.totalPrice}}</td>
				      	<td>{{pro.comment}}</td>
				      	<td>待发货</td>
						<td>{{pro.datetime}}</td>
						<td><a v-on:click="look(pro.id)" id="xiangqing">查看订单</a><a style="margin-left: 20px;" v-on:click="detail(pro.id)">退款</a></td>
					</tr>
				</table>
			</div>
		</div>
		<!--查询待收货订单-->
		<div id="motai4" class="rtcont fr" id="d3" style=" overflow-x: hidden; overflow-y: auto; overflow: scroll background-color:white;">
			<div class="ddzxbt"style="border: none;">{{check}}</div>
			<div class="table-responsive">
			<table id="downdowntable" class="table table-bordered">
					<tr>
						<th>订单编号</th>
						<th>订单价格</th>
						<th>订单备注</th>
						<th>订单状态</th>
						<th>订单时间</th>
						<th>操作</th>
					</tr>
					<tr v-for="pro in list3">
						<td>{{pro.id}}</td>
						<td>{{pro.totalPrice}}</td>
				      	<td>{{pro.comment}}</td>
				      	<td>待收货</td>
						<td>{{pro.datetime}}</td>
						<td><a v-on:click="look(pro.id)" id="xiangqing">查看订单</a></td>
					</tr>
				</table>
			</div>						
		</div>
		<!--查询已收货订单-->
		<div id="motai5" class="rtcont fr" style=" overflow: scroll background-color:white;">
			<div class="ddzxbt"style="border: none;">{{check}}</div>
			<div class="table-responsive">
			<table id="downdowntable" class="table table-bordered">
					<tr>
						<th>订单编号</th>
						<th>订单价格</th>
						<th>订单备注</th>
						<th>订单状态</th>
						<th>订单时间</th>
						<th>操作</th>
						<th>选择</th>
					</tr>
					<tr v-for="pro in list4">
						<td>{{pro.id}}</td>
						<td>{{pro.totalPrice}}</td>
				      	<td>{{pro.comment}}</td>
				      	<td>已签收</td>
						<td>{{pro.datetime}}</td>
						<td><a v-on:click="detail(pro.id)" id="xiangqing">查看订单</a></td>
					</tr>
				</table>
			</div>
			</div>
				<!--查询所有订单-->
		<div id="motai7" class="rtcont fr" id="d5" style="background-color:white;">
		    <div class="ddzxbt"style="border: none;">{{check}}</div>
		    <div class="table-responsive">
			<table id="downdowntable" class="table table-bordered">
					<tr>
						<th>订单编号</th>
						<th>订单价格</th>						
						<th>订单备注</th>
						<th>订单时间</th>
						<th>操作</th>
						<th>选择</th>
					</tr>
					<tr v-for="pro in list">
						<td>{{pro.id}}</td>
						<td>{{pro.totalPrice}}</td>
				      	<td>{{pro.comment}}</td>
						<td>{{pro.datetime}}</td>
						<td><a v-on:click="detail(pro.id)">删除</a></td>
						<td><a id="xiangqing" v-on:click="look(pro.id)"  data-toggle="modal" data-target="#myModal">查看订单详情</a></td>
					</tr>
				</table>
			</div>			
			<!--
        	作者：offline
        	时间：2018-08-16
        	描述：分页按钮
        -->
			<div> 
				<ul style="float: right;" class="pagination">					
		            <li><select v-on:change="orderchangepage" v-model="orderselected"><option v-for="p in orderpage">{{p}}</option></select>页</li>
		            <li class="gray">共{{orderpage}}页</li>
		       </ul>
				<nav aria-label="Page navigation">
				  <ul class="pagination">
				    <li>
				      <a @click="orderleft" aria-label="Previous">
				        <span aria-hidden="true">&laquo;</span>
				      </a>
				    </li>
				
				    <li>
				      <a @click="orderright" aria-label="Next">
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </li>
				  </ul>
				</nav>
			</div>
		</div>		
		<div id="motai8" class="rtcont fr" style="background-color:white;overflow: scroll; overflow-x: hidden; overflow-y: auto;">
			<div class="ddzxbt">我的收藏</div>
			<div id="start" >				
				<div class="main center" style="min-height: 730px; " >					
					<div  v-for="collect in collist" class="mingxing fl mb20 clearfix" style=" position: relative; width: 450px; height: 350px; margin:0px 10px 20px 0px; border:2px solid #fff;width:220px;cursor:pointer;" onmouseout="this.style.border='2px solid #fff'" onmousemove="this.style.border='2px solid red'">						
						<div class="sub_mingxing" ><a v-on:click="xqtz(collect.productCode)" href="xiangqing.html"  ><img width="200px" height="200px" v-bind:src="web_server_static+collect.collectProductPhoto" alt=""></a></div>
						<div class="pinpai" style="text-align: center;" ><a>{{collect.productName}}</a></div>
						<div class="youhui" style="text-align: center;" >{{collect.productComment}}</div>
						<div class="jiage" style="text-align: center;" >{{collect.productPrice}}元</div>
						<button  class="btn btn-primary" @click="move(collect.collectId)" style=" position: absolute; margin-left: 80px;bottom: 2px;">移除商品</button>
					</div>
				</div>								
			</div>
		</div>						
			<!---->
		</div>
	</div>
	<footer class="mt20 center">		
			<div class="mt20">小米商城|MIUI|米聊|多看书城|小米路由器|视频电话|小米天猫店|小米淘宝直营店|小米网盟|小米移动|隐私政策|Select Region</div>
			<div>©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号</div> 
			<div>违法和不良信息举报电话：151-3503-4757，本网站所列数据，除特殊说明，所有数据均出自昭平科技实验室测试</div>
		</footer>
</div>
	</body>	
	<script>
		var a=window.sessionStorage.getItem("code");
		//alert(a);
		var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
		var vue=new Vue({
			el:"#ddd",
			data:{
				userid1:'',
				name11:"",
				phone11:"",
				password11:"",
				qming11:"",
				age11:"",
				address11:"",
				birthday:"",
				photo:"",
				status:"",
				information:"",
				numberdaoji:4,							
				list:[],
				list1:[],
				list2:[],
				list3:[],
				list4:[],
				list5:[],
				orderpage:1,
				orderselected:1,
				testnum:"",
				usernumber:"",
				listid:"",
				page:"1",
				check:'',
				collist:[],
				productCode:'',
				web_server:window.web_server ,
				uuu:window.sessionStorage.getItem('loginUsername'),
				omg:'',
				web_server_static:window.web_server_static,
				lmuid:window.sessionStorage.getItem("loginUserid"),
			},
			created:function(){
				this.dengl()
			},
			methods:{
				dengl:function(){
//						var uuu=window.sessionStorage.getItem('loginUsername');
						if(this.uuu==null){
							this.omg="登录";														
						}else{
								this.omg=this.uuu;
						}													
					},
					jump:function(){
					if(this.uuu!=null){
						window.location.href="self_info.html";
					}else{
						window.location.href="login.html";
					}
				},
				cx:function(){	
					var self =this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/collect/select",{
					    params: {
					      UserId:self.lmuid,					     
					    }
					  }).then(function(response){
						var object =  response.data;
						if(object.status==200){
							self.collist = object.data; 
						}else{
							self.collist =[];
						}
					}).catch(function(error){
						console.log(error)
					})
				
					},
					//移除
				move:function(collectId){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/collect/delete?CollectId="+collectId).then(function(response){
						var object = response.data;
						if(object.status==200){
							self.cx();
						}else{
							self.cx();
						}
					}).catch(function(error){
						console.log(error)
					})
					
				},
					//点击跳转
				xqtz:function(productCode){
					window.sessionStorage.setItem("productCode",productCode);
					
				},
				vary:function(event){
						 var el =event.currentTarget;
          				 var str=el.innerHTML
						 this.check=str;	
				},
				dian5:function(page){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/PageOrderServlet",{
						params:{
							'userId':self.lmuid,
							'page':page
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
							self.list=obj.data.list;
							self.orderpage=obj.data.totalPage;
						}
					})
				},
				dian4:function(){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/ReceivedGoodServlet",{
						params:{
							orderUserId:self.lmuid,
							page:self.page
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
//							alert(JSON.stringify(obj));
							 self.list4=obj.data;
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				dian3:function(){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/GoodsReceivedServlet",{
						params:{
							orderUserId:self.lmuid,
							page:self.page
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
							 self.list3=obj.data;
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				dian2:function(){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/AlreadyPaidServlet",{
						params:{
							orderUserId:self.lmuid,
							page:self.page
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
//							alert(JSON.stringify(obj));
							 self.list2=obj.data;
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				dian1:function(){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/UnpaidsServlet",{
						params:{
							orderUserId:self.lmuid,
							page:self.page
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
//							alert(JSON.stringify(obj));
							if(obj.data==""){
								alert("没有未付款订单！")
							}
							self.list1=obj.data;
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				//删除订单
				detail:function(detailId){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/DeleteOrderServlet",{
				    params:{
				      'orderId':detailId,
				      'userId':self.lmuid,
				      'page':self.page
				   	 	}
				    })
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){							
							self.list=obj.data.list;
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				//取消订单
				Cancel:function(orderid){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/CancellationOrdersServlet",{
				    params:{
				      'orderId':orderid
				   	 	}
				    })
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
						 self.list1=obj.data;	
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				//查看详情
				look:function(orderId){
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/order/OrderDetailsServlet",{
				    params:{
				      'orderId':orderId
				   	 	}
				    })
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
						self.usernumber=obj.data[0].userId;
						self.listid=obj.data[0].id;
						self.list5=obj.data[0].list;
						
						}
					})
					.catch(function(error){
						alert(error);
					})
				},
				//订单结算
				price:function(orderid){
					window.location.href=web_server+"order/YeePayServlet?orderId="+orderid;
				},
					orderchangepage: function () {//用户页数选择改变
	   			 		var self=this;
	   			 		self.dian5(self.orderselected); 
	     			},
	     			orderleft:function(){//用户页数向左
	     				var self=this;
	     				if(self.orderselected<=1){
	     				}else{
	     					self.orderselected=self.orderselected-1;
	     					self.dian5(self.orderselected); 
	     				}
	     			},
		     		orderright:function(){//用户页数向右
			     		var self=this;
			     		if(self.orderselected>=self.orderpage){
			     		}else{
			     			self.orderselected=self.orderselected+1;
			     			self.dian5(self.orderselected); 	
			     		}
			     	},				
				xinxi:function(){
					
					var self=this;
					//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/user/select",{
						params:{
							'userId':self.lmuid
						}
					})
					.then(function(response){
						var obj=response.data;
						if(obj.status==200){
						self.userid1=obj.data[0].userId;
						self.name11=obj.data[0].userName;
						self.phone11=obj.data[0].userTelphone;
						self.password11=obj.data[0].userPassword;
						self.qming11=obj.data[0].userComment;
						self.age11=obj.data[0].userAge;
						self.address11=obj.data[0].userAddress;
						self.birthday=obj.data[0].userBirthday;
						self.photo=obj.data[0].userPhoto;
						self.sex=obj.data[0].userSex;
						self.status=obj.data[0].userStatus;
						}
					})
			},
			altermessage:function(){
				var self=this;
				if(self.name11==""){
			    self.information="您的昵称不能为空,修改失败";
				return false;
				}
				if(self.password11==""){
			    self.information="您的密码不能为空,修改失败";
				return false;
				}
				if(self.phone11==""){
			    self.information="您的手机号不能为空,修改失败";
				return false;
				}
				if(myreg.test(self.phone11)==false){
				self.information="您输入的手机号不符合规则，请您重新输入";
				return false;
				}
				//必须要写
					axios.defaults.withCredentials = true;
					axios.get(web_server+"api/user/alter",{
						params:{
						'userId':self.userid1,
						'userName':self.name11,
						'telphone':self.phone11,
						'password':self.password11,
						'comment':self.qming11,
						'age':self.age11,
						'address':self.address11,
						'birthday':self.birthday,
						'photo':self.photo,
						'sex':self.sex,
						'status':self.status
						}
					})
					.then(function(response){
						alert(JSON.stringify(resopnse))
						var obj=response.data;
						if(obj.status==200){
							alert("修改成功")
							self.information=obj.message;
							window.location.href="self_info.html";
							self.altermessage()
						}
						if(obj.status==404){
							self.information=obj.message;
						}
						if(obj.status==500){
							self.information=obj.message;
						}
					})
				},
			setTimer:function(){
				var self=this;
				this.timer=setInterval(() => {
				　　 self.numberdaoji--;
					if(self.numberdaoji==0){
				       	self.information="";
				       	self.numberdaoji=4;
				       }
				}, 1000)				
				},
			//全部商品
			search:function(){
					var a=document.getElementById("inp").value;
					window.sessionStorage.setItem("fuzzy",a);
					if(1==1){
						window.location.href="search.html";
					}
					
				},
				//分类搜索
				go:function(name){
					//存类名
					window.sessionStorage.setItem("name",name);
				}
			}
		})
		
	</script>
</html>

